package org.tlipoca.smsteamplayer.controller;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.genntii.smcommon.result.Result;
import org.genntii.smdomain.entity.SteamPlayer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.tlipoca.smsteamplayer.service.SteamPlayerService;

@Tag(name = "Steam用户")
@Slf4j
@RestController
@RequestMapping("/steam_player")
public class SteamPlayerController {

    @Autowired
    private SteamPlayerService steamPlayerService;

    @Operation(summary = "根据steamid查询steam用户信息")
    @GetMapping("/{steamid}")
    public Result<SteamPlayer> getSteamPlayerBySteamid(@PathVariable String steamid) {
        return Result.success(steamPlayerService.getSteamPlayerBySteamidService(steamid));
    }
}
